package cn.consult.controller.sys.apartment.instruct;

import cn.consult.common.api.CommonResult;
import cn.consult.sys.service.TWeEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ Author：周xx
 * @ Date：2024-04-11-9:26
 * @ Version：1.0
 * @ Description：
 */
@Api(tags = "水表指令")
@RestController
@RequestMapping("/water/instruct")
public class WaterInstructController {

    @Autowired
    TWeEquipmentService tWeEquipmentService;


    @ApiOperation("operationWater =>  水表操作")
    @GetMapping("/operationWater/{id}/{type}")
    public CommonResult instructWater(@PathVariable Long id, @PathVariable Long type, HttpServletRequest request) {
        boolean flag = tWeEquipmentService.operationWater(id,type,request);
        if (flag) {
            return CommonResult.success();
        }
        return CommonResult.failed();
    }

}
